<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class ReimburseDetail extends Model
{
    use HasFactory;
    protected $fillable = ['reimburse_id','project_id','title','type','project','status','price','audit_price','remarks','unit','nums','tax_rate','tax_price','invoice'];

    const POSTONLY = ['reimburse_id','project_id','title','type','project','status','price','audit_price','remarks','unit','nums','tax_rate','tax_price','invoice'];

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

    public function Reimburse()
    {
        return $this->hasOne(Reimburse::class,'id','reimburse_id');
    }
}
